package com.xm_jd.controller.jiesuan;

import com.xm_jd.model.dao.BalanceDao;
import com.xm_jd.model.entitys.tb_sh;
import com.xm_jd.model.entitys.user;
import com.xm_jd.utils.BaseServlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class MoaddressSe
 */
@WebServlet("/MoaddressSe")
public class MoaddressSe extends BaseServlet {
	private static final long serialVersionUID = 1L;

    /**
     * Default constructor. 
     */
    public MoaddressSe() {
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
				String shuor=request.getParameter("shr");
				String xiadi=request.getParameter("xiangzi");
				String phonea=request.getParameter("shouji");
				String sheng=request.getParameter("sheng");
				String shi=request.getParameter("shi");
				String qu=request.getParameter("qu");
				String moren=request.getParameter("mo");
				user aa = (user)request.getSession().getAttribute("users");
				BalanceDao dao =new BalanceDao();
				int j=dao.updatemoren(aa.getUser_id());
				String a="0";
				if(!moren.equals("")){
					a="1";
				}
				tb_sh s=new tb_sh(1,sheng+shi+qu,xiadi,shuor,phonea,moren,aa.getUser_id());
				
				int xin=dao.addgood(s);
				this.forward("JDjiesuan");
				
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
